package com.xiaofeng.pochi.mapper;

import com.xiaofeng.pochi.common.Page;
import com.xiaofeng.pochi.pojo.ShopOrder;
import com.xiaofeng.pochi.pojo.vo.OrderMonthVo;
import com.xiaofeng.pochi.pojo.vo.OrderPointVo;
import com.xiaofeng.pochi.pojo.vo.ShopOrderVo;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created with IntelliJ IDEA
 *
 * @Author: chc
 * @Date: 2022/09/17/23:42
 * @Description:
 */
@Component
public interface ShopOrderMapper {

    /**
     * 添加
     * @param order
     */
    void save(ShopOrder order);

    ShopOrder getPayInfo(ShopOrder order);

    /**
     * 根据id查询
     * @param orderId
     * @return
     */
    ShopOrder get(Long orderId);

    /**
     * 修改订单状态
     * @param order
     */
    void updateOrderStatus(ShopOrder order);

    /**
     * 分页查询
     * @param page
     * @return
     */
    List<ShopOrder> getMyOrder(Page<ShopOrderVo> page);


    /**
     * 查询总数
     * @param page
     * @return
     */
    Integer getMyOrderCount(Page<ShopOrderVo> page);

    List<ShopOrder> getByPage(Page<ShopOrder> page);

    Integer getCountByPage(Page<ShopOrder> page);

    /**
     * 月订单统计
     * @return
     */
    List<OrderMonthVo> monthOrder();


    /**
     * 查询每种订单占比
     * @return
     */
    List<OrderPointVo> orderPoint();

}
